package edu.citadel.domain;

import edu.citadel.db.JobDao;
import org.springframework.beans.factory.annotation.Autowire;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;

import java.util.List;

/**
 * User: jordan
 * Date: 3/10/13
 * Time: 1:41 PM
 */
@Configurable(autowire = Autowire.BY_TYPE)
public class Job {
    @Autowired
    private JobDao jobDao;
    private List<WorkItem> jobWorkItems;
    private String type;
    private String location;
    private int clientId;
    private int jobId;

    public void save() {
        jobDao.save(this);
    }

    public Job() {}

    public int getJobId() {
        return jobId;
    }

    public void setJobId(int jobId) {
        this.jobId = jobId;
    }

    public Job(int clientId) {
        this.clientId = clientId;
    }

    public int getClientId() {
        return clientId;
    }

    public void setClientId(int clientId) {
        this.clientId = clientId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public void addWorkItem(WorkItem item) {
        this.jobWorkItems.add(item);
    }

    public List<WorkItem> getJobWorkItems() {
        return jobWorkItems;
    }

    public void setJobWorkItems(List<WorkItem> jobWorkItems) {
        this.jobWorkItems = jobWorkItems;
    }

    public void setJobDao(JobDao jobDao) {
        this.jobDao = jobDao;
    }
}
